<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			*{
				padding: 0;
				margin: 0;
			}
			#beijing{
				width:800px;
				height: 400px;
				background: red;
			}
			#chaoyang{
				width: 500px;
				height: 300px;
				background: orange;
			}
			#shunbailu{
				width: 400px;
				height: 150px;
				background: green;
			}
		</style>
		<script>
			//冒泡型事件流是由最明确事件源到不明确的
			window.onload=function(){
				document.getElementById("beijing").onclick=function(){
					alert('北京');
				}
				document.getElementById("chaoyang").onclick=function(e){
					alert('朝阳');
					var ev=window.event || e;
					if(document.all){
						ev.cancelBubble=true;
					}
					else{
						ev.stopPropagation();
					}
				}
				document.getElementById("shunbailu").onclick=function(){
					alert('顺白路');
				}
			}
		</script>
	</head>
	<body>
		<div id="beijing">
			北京
			<div id="chaoyang">
				朝阳
				<div id="shunbailu">顺白路</div>
			</div>
		</div>
	</body>
</html>
